import { /* inject, */ BindingScope, injectable, service} from '@loopback/core';
// import {User} from '../models';
// import {UserRepository} from '../repositories';
import {GetTokenService} from './common/get-token.service';

@injectable({scope: BindingScope.TRANSIENT})
export class UserService {
  constructor(
    // @repository(UserRepository)
    // public userRepository: UserRepository,
    @service(GetTokenService) public getTokenService: GetTokenService
  ) { }


  /**
   * 查询是否有此用户
   * @param user
   * @returns
   */
  async getUser() {
    // const res = await this.userRepository.find({
    //   where: {
    //     name: user.name,
    //     password: user.password,
    //   },
    // })
    // // console.log(res);
    // if (res.length) {
    //   return this.getTokenService.getToken();
    // } else {
    //   throw new Error('error');
    // }
  }
}
